<?php


namespace app\webactive\controller;


use app\common\lib\exception\ApiException;
use think\Controller;
use think\Exception;
use think\Log;

class Auth2 extends Controller
{
    protected $user = null;
    protected $isTest = false; // 是否是测试

    protected function _initialize()
    {
        parent::_initialize();

        try
        {
            $auth = new \app\api\controller\v13\Auth2();
            $this->user = $auth->user;
        }
        catch (Exception $e)
        {
            Log::write('活动请求头：' . \GuzzleHttp\json_encode($this->request->header(), JSON_UNESCAPED_UNICODE), 'error', true);
            Log::write('错误消息：' . $e->getMessage() . '错误文件' . $e->getFile() . '错误行数' . $e->getLine(), 'error', true);
            throw new ApiException('活动异常' . $e->getMessage());
        }
    }
}
